<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="百度地图,百度地图API，百度地图自定义工具，百度地图所见即所得工具" />
    <meta name="description" content="百度地图API自定义地图，帮助用户在可视化操作下生成百度地图" />
    <title>百度地图API自定义地图</title>
    <!--引用百度地图API-->
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=9FEijeOWGUrd6GcQq1g8ZaPNW683Ns2K"></script>
  </head>
    <link rel="stylesheet" href="./茶联系.css">
<body>
 <!-- header -->
 <header>
    <div class="head">
        <div class="logo"><img src="./img/img/logo.webp" alt=""></div>
        <ul class="table">
            <li><a href="../01茶首页/茶首页.html">首页</a>
                <div class="underline"></div>
            </li>
            <li><a href="../02茶关于/茶关于.html">关于</a>
                <div class="underline"></div>
            </li>
            <li><a href="../03茶叶/茶叶.html">茶叶</a>
                <div class="underline"></div>
            </li>
            <li><a href="../04茶基地/茶基地.html">基地</a>
                <div class="underline"></div>
            </li>
            <li><a href="../05茶新闻/茶新闻.html">新闻</a>
                <div class="underline"></div>
            </li>
            <li><a href="./茶联系.html">联系</a>
                <div class="underline"></div>
            </li>
        </ul>
        <div class="ico">
            <div><img src="./img/img/搜索.png" alt="" onclick="location.href=('../03茶叶/茶叶.html')"></div>
            <div><img src="./img/img/用户.png" alt="" onclick="location.href=('../登录注册/登陆注册.html')"></div>
            <div><img src="./img/img/购物车.png" alt="" onclick="location.href=('../购物车/view/购物车.html')"></div>
        </div>
    </div>
</header>
    <!-- 大图 -->
    <div class="bgc">
        <img src="./img/茶大图.webp" alt="">
    </div>
     <!-- content -->
     <div class="content">
        <div>
            中国历史上有很长的饮茶纪录，已经无法确切地查明到底是在什么年代了，
            但是大致的时代是有说法的。并且也可以找到证据显示，
            确实在世界上的很多地方饮茶的习惯是从中国传过去的。
        </div>
    </div>
    <!-- 三张图 -->
     <div class="threeimg">
        <div class="part">
            <div>
                <img src="./img/短信.webp" alt="">
            </div>
            <div  style="padding: 17px 0px 0px;">
                <span>邮箱</span>
            </div>
            <div style="padding: 7px 0px 0px;">
                <span>info@email.com</span>
            </div>
        </div>
        <div class="line"></div>
        <div class="part">
            <div>
                <img src="./img/电话.webp" alt="">
            </div>
            <div  style="padding: 17px 0px 0px;">
                <span>邮箱</span>
            </div>
            <div style="padding: 7px 0px 0px;">
                <span>info@email.com</span>
            </div>
        </div>
        <div class="line"></div>
        <div class="part">
            <div>
                <img src="./img/地址.webp" alt="">
            </div>
            <div  style="padding: 17px 0px 0px;">
                <span>邮箱</span>
            </div>
            <div style="padding: 7px 0px 0px;">
                <span>info@email.com</span>
            </div>
        </div>
     </div>
     <div class="position">
        <div class="area">
            <div style="width:1149px;height:400px;border:#ccc solid 1px;font-size:12px" id="map"></div>
        </div>
     </div>
     <!-- 页脚 -->
     <div class="foot">
        <div class="footle">
            <div>
                <div>联系</div>
                <div>Contact</div>
            </div>
            <div>
                <div>关注我们</div>
                <div>
                   
                        <img src="./img/img/微信图标.png" alt="">
                        <img src="./img/img/微博图标.png" alt="">
                </div>
            </div>
            <div class="gsjj">
                <div class="gsjjup" style="font-size: 16px;">起飞页自助建站平台</div>
                <div class="gsjjlo">
                    <div style="font-size: 14px;height: 25px;"><span>地址：苏州市建外SOHO东区2号楼</span></div>
                    <div style="font-size: 14px;height: 25px;"><span>邮编：100000</span></div>
                    <div style="font-size: 14px;height: 25px;"><span>电话：010-69557550</span></div>
                </div>
            </div>
        </div>
        <div  class="footri">
            <div>
                <div><img src="./img/img/wx.webp" alt=""></div>
                <div>微信</div>
            </div>
            <div>
                <div><img src="./img/img/wb.webp" alt=""></div>
                <div>微博</div>
            </div>
        </div>
     </div>
     <div class="talk">
        <div>COPYRIGHT (©) 2019 茶叶类网站  京ICP备11111111号</div>
     </div>
</body>
</html>    
<script type="text/javascript">
     window.onload=function(){
    //获取cookie
   let cookieStr= document.cookie;
   let cookirArr=cookieStr.split(";");
   let bool=false;
   let username;;
   for(let i=0;i<cookirArr.length;i++){
        //去除空格
     let str=cookirArr[i].trim();

      let key="username=";
      if(str.startsWith(key)){
        bool=true;
        username=str.substring(key.length,str.length);
        break;
      }
   }

   //判断bool标记值
   if(bool){
    console.log(username);
   }else{
        location.href='登录注册.html'
   }
}
    //创建和初始化地图函数：
    function initMap(){
      createMap();//创建地图
      setMapEvent();//设置地图事件
      addMapControl();//向地图添加控件
      addMapOverlay();//向地图添加覆盖物
    }
    function createMap(){ 
      map = new BMap.Map("map"); 
      map.centerAndZoom(new BMap.Point(113.716223,34.756976),14);
    }
    function setMapEvent(){
      map.enableScrollWheelZoom();
      map.enableKeyboard();
      map.enableDragging();
      map.enableDoubleClickZoom()
    }
    function addClickHandler(target,window){
      target.addEventListener("click",function(){
        target.openInfoWindow(window);
      });
    }
    function addMapOverlay(){
      var markers = [
        {content:"公司",title:"我的标记",imageOffset: {width:0,height:3},position:{lat:34.753595,lng:113.708659}}
      ];
      for(var index = 0; index < markers.length; index++ ){
        var point = new BMap.Point(markers[index].position.lng,markers[index].position.lat);
        var marker = new BMap.Marker(point,{icon:new BMap.Icon("http://api.map.baidu.com/lbsapi/createmap/images/icon.png",new BMap.Size(20,25),{
          imageOffset: new BMap.Size(markers[index].imageOffset.width,markers[index].imageOffset.height)
        })});
        var label = new BMap.Label(markers[index].title,{offset: new BMap.Size(25,5)});
        var opts = {
          width: 200,
          title: markers[index].title,
          enableMessage: false
        };
        var infoWindow = new BMap.InfoWindow(markers[index].content,opts);
        marker.setLabel(label);
        addClickHandler(marker,infoWindow);
        map.addOverlay(marker);
      };
    }
    //向地图添加控件
    function addMapControl(){
      var scaleControl = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
      scaleControl.setUnit(BMAP_UNIT_IMPERIAL);
      map.addControl(scaleControl);
      var navControl = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
      map.addControl(navControl);
      var overviewControl = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:true});
      map.addControl(overviewControl);
    }
    var map;
      initMap();
  </script>